package com.bfs.anasit.model;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Model;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.inject.Named;
import javax.persistence.*;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: lukman
 * Date: 6/12/11
 * Time: 9:34 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Named
@Dependent
public class AnasitRole {
    private Long id;
    private String role;
    private List<AnasitUser> users;
    /*
    *for Jetty JAAS username mapping
    */
    private String user;


    @Id
    @GeneratedValue
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @OneToMany(mappedBy = "role")
    public List<AnasitUser> getUsers() {
        return users;
    }

    public void setUsers(List<AnasitUser> users) {
        this.users = users;
    }


}
